﻿using ShareCode.Util;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Infrastructure.Util
{
    public class SnowflakeIDcreator : SnowflakeIDcreatorBase
    {
        public void SetWorkerID()
        {

            int _WorkerId = 0;
            this.WorkerId = _WorkerId;
        }

        public void DatacenterID()
        {
            int _DatacenterId = 0;
            this.DatacenterId = _DatacenterId;
        }

        public static long NextId()
        {
            if (snowflakeIDcreator == null)
            {
                snowflakeIDcreator = new SnowflakeIDcreator();
                ((SnowflakeIDcreator)snowflakeIDcreator ).SetWorkerID();
                ((SnowflakeIDcreator)snowflakeIDcreator).DatacenterID();
            }

            return snowflakeIDcreator._NextId();
        }
    }
}
